package com.hunt.controller;

import com.hunt.model.dto.PageInfo;
import com.hunt.service.ActivityLogService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.ResponseBody;

/**
 * @author nine
 * @date 2024/5/24/024
 * @Description
 */
@Api(value = "客服开号操作日志管理模块")
@Controller
@RequestMapping("activitylog")
public class ActivityLogController extends BaseController{
    @Autowired
    private ActivityLogService activityLogService;

    @ApiOperation(value = "跳转至客服开号操作日志管理模块", httpMethod = "GET", produces = "text/html")
    @RequestMapping(value = "activitylog", method = RequestMethod.GET)
    public String activityLog() {
        return "system/activitylog";
    }


    @ApiOperation(value = "获取客服开号操作日志统计", httpMethod = "GET",produces = "application/json", response = PageInfo.class)
    @ResponseBody
    @RequestMapping(value = "activitylogget", method = RequestMethod.GET)
    public PageInfo activitylogget(@RequestParam(value = "page",defaultValue = "1") Integer page ,
                                   @RequestParam(value = "rows",defaultValue = "3") Integer rows,
                                   @RequestParam(defaultValue = "", required = false) String operator,
                                   @RequestParam(defaultValue = "", required = false) String operationType) {
        return  activityLogService.getactivitylogs(page,rows,operator,operationType);
    }
}
